<%@page import="enterprises.Enterprise"%>
<%@page import="org.codehaus.groovy.grails.web.context.ServletContextHolder"%>
<%=packageName%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <title>Enterprise details</title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="list" href="${createLink(action:"list")}"/>Enterprise List</a></span>          
        </div>
        <div class="body">           	     
        	<h1>IndustrialSector:   ${industrialSector?.name}</h1>
        	<% if (enterprisesStat.size != 0 ) { %> 
        	<div class="list">
                <table>
                    <thead>
                        <tr>
                        	<th>Count Enterprises</th>
                        	<th>Count Workers</th>
                        	<th>Man Count</th>
                        	<th>Women Count</th>
                        	<th>ITR Count</th>
                        	<th>Summary Area</th> 
                        	<th>Free Area</th>
                        	<th>Busy Area</th>   
                        	<th>Possible building area</th>                    																							
                        </tr>
                    </thead>
                    <tbody>
                    		<tr>
							<td>${enterprisesStat[0][1]}</td>
							<td>${enterprisesStat[0][2]}</td>
							<td>${enterprisesStat[0][3]}</td>
							<td>${enterprisesStat[0][4]}</td>
							<td>${enterprisesStat[0][5]}</td>
							<td>${enterprisesStat[0][6]}</td>
							<td>${enterprisesStat[0][7]}</td>
							<td>${enterprisesStat[0][8]}</td>
							<td>${enterprisesStat[0][9]}</td>
							
                    		</tr>
                    </tbody>
                </table>               
            </div>
			<% } %>
			  
			<br/>                	        	      
        	
        	<% if (ownershipStat.size != 0 ) { %> 
        	<div class="list">
                <table>
                    <thead>
                        <tr>
                        	<th>Type Ownership</th>
                        	<th>Count Enterprises</th>                        	                   																				
                        </tr>
                    </thead>
                    <tbody>
                    		<g:each in="${ownershipStat}" status="i" var="stat">
								<tr class="\${(i % 2) == 0 ? 'odd' : 'even'}">
									<td>${stat[0]}</td>
									<td>${stat[1]}</td>
								</tr>
							</g:each>
                    </tbody>
                </table>               
            </div>
			<% } %>
			<br/>			
			<% if (providersStat.size != 0 ) { %> 
        	<div class="list">
                <table>
                    <thead>
                        <tr>
                        	<th>Type Provider</th>
                        	<th>Count Providers</th>                        	                   																				
                        </tr>
                    </thead>
                    <tbody>
                    		<g:each in="${providersStat}" status="i" var="stat">
								<tr class="\${(i % 2) == 0 ? 'odd' : 'even'}">
									<td>${stat[0]}</td>
									<td>${stat[1]}</td>
								</tr>
							</g:each>
                    </tbody>
                </table>               
            </div>
			<% } %>
			<br/>
			
			<% if (consumersStat.size != 0 ) { %> 
        	<div class="list">
                <table>
                    <thead>
                        <tr>
                        	<th>Type Consumer</th>
                        	<th>Count Consumers</th>                        	                   																				
                        </tr>
                    </thead>
                    <tbody>
                    		<g:each in="${consumersStat}" status="i" var="stat">
								<tr class="\${(i % 2) == 0 ? 'odd' : 'even'}">
									<td>${stat[0]}</td>
									<td>${stat[1]}</td>
								</tr>
							</g:each>
                    </tbody>
                </table>               
            </div>
			<% } %>        	        
        </div>
                
    </body>
</html>
